-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL: add PipeOperationImpl to reduce duplicate code #872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฆฌ๋ทฐ ์๋ฃ
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
@uhm0311 @jhpark816 ๋ค์ ๋ฆฌ๋ทฐ ๋ถํ๋๋ฆฝ๋๋ค. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ผ๋ถ ๋ฆฌ๋ทฐ
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ถ๊ฐ ๋ฆฌ๋ทฐ
src/main/java/net/spy/memcached/protocol/ascii/PipeOperationImpl.java
Outdated
Show resolved
Hide resolved
} else { | ||
index++; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ง๋ฌธ์
๋๋ค.
isNotPiped() ๊ฒฝ์ฐ์์ NOT_MY_KEY ์๋ต์ ๋ฐ์ผ๋ฉด,
single key pipe์ด๋ multi key pipe์ด๋ ๊ด๊ณ์์ด ์๋ ๋ก์ง์ ์ฌ์ฉํ ์ ์๋์?
addRedirectSingleKeyOperation(line, keys.get(index));
transitionState(OperationState.REDIRECT);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ์ํ์ ๋ก์ง์ ์ฌ์ฉํด๋ ์ ์ ๋์ํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
isNotPiped์ธ ๊ฒฝ์ฐ๊ฐ ๋ฐ์ํ๋ ค๋ฉด 1. ์ฒ์๋ถํฐ ๋ ธ๋์ ๋ณด๋ผ ์ฐ์ฐ์ ํค๊ฐ 1๊ฐ๋ฟ์ด๊ฑฐ๋, 2. ๋งจ ๋ง์ง๋ง ์ฐ์ฐ๋ง ๋นผ๊ณ ์ด๋ฏธ ์ํ๋ ์ํ์์ switchover/redirect๋ก ์ธํด ๋ค์ ์์ฒญ์ ๋ณด๋์ ๋ ๋ฟ์ ๋๋ค.
- 1๋ฒ ์ผ์ด์ค
- ๋ด๋ถ์ ํค๊ฐ ํ๋๋ฟ์ธ single key redirect handler๋ฅผ ์์ฑํ์ฌ, ๋ฆฌ๋ค์ด๋ ํธํ ์บ์ ๋ ธ๋๋ฅผ ์ฐพ๊ณ ํด๋น ํค์ ๋ํด์๋ง ์์ฒญ์ ๋ณด๋ ๋๋ค.
- 2๋ฒ ์ผ์ด์ค
- ๊ธฐ์กด์ NOT_MY_KEY ์๋ต์ ๋ฐ์๋ค๋ฉด ์ด๋ฏธ ๋ด๋ถ์ ํค๊ฐ ํ๋ ์ด์ ์กด์ฌํ๋ multi key redirect handler๊ฐ ์์ฑ๋ ์ํ์ ๋๋ค. ๋ฐ๋ผ์ ์ด ํธ๋ค๋ฌ์ ๋จ์ํ ํค๋ง ์ถ๊ฐํ๊ฒ ๋์ด ์ดํ ๋์์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
- redirect handler๊ฐ ์กด์ฌํ์ง ์์๋ค๋ฉด ๋ด๋ถ์ ํค๊ฐ ํ๋๋ฟ์ธ single key redirect handler๋ฅผ ์์ฑํ์ฌ, ๋ฆฌ๋ค์ด๋ ํธํ ์บ์ ๋ ธ๋๋ฅผ ์ฐพ๊ณ ํด๋น ํค์ ๋ํด์๋ง ์์ฒญ์ ๋ณด๋ ๋๋ค.
๐ Related Issue
โจ๏ธ What I did